### Project 27 Rotary Potentiometer **1.Overview** When we conduct DIY experiments, we often use the adjustable potentiometer, which is also a 10K adjustable resistor in nature. In this experiment, the Keyestudio Micro Bit Honeycomb rotary potentiometer is controlled by the P0 on Micro: Bit main board. By rotating the potentiometer, the analog value data changes, and the measured analog value is displayed on the CoolTerm serial port monitor.At the same time, the brightness of LED connected to P1 interface also gradually changes. **2.Components Required** - Micro:bit Main Board\*1 - Keyestudio Edge Connector IO Breakout Board for Micro:bit\*1 - USB Cable\*1 - keyestudio Analog Rotation Sensor\*1 - keyestudio Digital 1W LED Module\*1 - Alligator Clip Wire\*6 **3.Component Introduction** ![](media/image-20260128151935450.png) **About Keyestudio micro bit honeycomb rotary potentiometer module** The keyestudio micro bit honeycomb rotary potentiometer module is fully compatible with micro bit control board. In the experiment, we connect the module to the micro:bit control board using crocodile clip wires. There are 6 ports on the module and those marked in the same name are connected. To link it with the micro:bit control board, we only need to connect 3 ports, that’s G to GND, V to 3V and S to a signal port(port 0,1 or 3). The module uses a 10K adjustable resistor. By rotating the potentiometer, we can change the value of the resistor and then build a circuit to convert the resistance change into the voltage change. **4.Technical Parameters** - Working voltage: DC 3.0-3.3V - Control port: analog port - Size: 25mm\*28mm\*26mm - Weight: 6.7g - Environmental attributes: ROHS **5.Connection Diagram** Attach the main board to Keyestudio Edge Connector IO Breakout Board for Micro:bit; Connect the keyestudio micro bit honeycomb rotary potentiometer module to the shield with 3 Alligator clip cables; Ring S to P0, V to 3V, and G to GND. Connect the keyestudio micro bit 1W LED module to the shield with 3 Alligator clip cables. Ring S to P1, V to 3V, and G to GND. Interface the micro:bit to your computer with a micro USB cable. ![](media/image-20260128163817140.png) **6.Coding** So now let's move to coding. Below are some steps to follow. Open the [https://makecode.micro:bit.org/\#editor](https://makecode.microbit.org/#editor) to write your code. Microsoft MakeCode is actually a platform that allows us to code for a micro:bit, and also provides an interactive simulator where we can debug and run our code, and will be able to see what to expect out right there on the site. Go to MakeCode and choose **My Projects** and click on **New Projects**. If you want to see the codes behind, then you can click on JavaScript and it will display JavaScript code there in IDE. ![](media/image-20260128163906039.png) **7.The following test code is for your reference** ![](media/image-20260128163933851.png) ![](media/image-20260128163940002.png) **8.Test Results** Connect micro:bit to computer via USB cable and transfer code to micro:bit. Open CoolTerm, click Options and select SerialPort, set COM port and baud rate(115200). Click OK and Connect. Adjust the potentiometer, when the analog value grows, red LED will become brighter, on the contrary, the smaller the analog value is, the darker the red LED gets. ![](media/image-20260128164000491.png)